package com.hoas.quickstart.threads.chapter02.chapter02_2_11_02;

public class Service {

    Object object1 = new Object();

    public void methodA() {

        synchronized (object1) {

            System.out.println("methodA begin");

            boolean isCountinueRun = true;
            while (isCountinueRun) {

            }

            System.out.println("methodA end");

        }


    }

    Object object2 = new Object();

    public void methodB() {

        synchronized(object2) {

            System.out.println("methodB begin");

            System.out.println("methodB end");

        }


    }

}
